#include <stdio.h>

#define ROWS 3
#define COLS 3

void zhuanhuang(int source[ROWS][COLS], int des[COLS][ROWS]) {
    int i, j;
    for (i = 0; i < ROWS; i++) {
        for (j = 0; j < COLS; j++) {
            des[j][i] = source[i][j];
        }
    }
}

int main() {
    int source[ROWS][COLS] = {
        {1, 2, 3},
        {5, 6, 7},
        {9, 10, 11}
    };

    int des[COLS][ROWS];

    zhuanhuang(source, des);

    printf("原来的矩阵:\n");
    for (int i = 0; i < ROWS; i++) {
        for (int j = 0; j < COLS; j++) {
            printf("%d ", source[i][j]);
        }
        printf("\n");
    }

    printf("\n转换后的矩阵:\n");
    for (int i = 0; i < COLS; i++) {
        for (int j = 0; j < ROWS; j++) {
            printf("%d ", des[i][j]);
        }
        printf("\n");
    }

    return 0;
}
